package com.wss.lsl.alading.service;

import com.wss.lsl.alading.mapper.MemberMapper;
import com.wss.lsl.alading.util.SecurityUtil;
import java.util.HashMap;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class LoginService implements ILoginService {

    private Logger logger = LoggerFactory.getLogger(this.getClass());
    @Autowired
    private MemberMapper memberMapper;

    @Override
    public boolean checkUsernamePassword(String username, String password) {

        Map<String, Object> params = new HashMap<String, Object>();
        params.put("username", username);
        params.put("password", SecurityUtil.md5(password));

        return memberMapper.checkUsernamePassword(params) > 0;
    }
}
